package org.ibase4j.provider.sys;

import org.ibase4j.core.base.BaseProviderImpl;
import org.ibase4j.core.support.dubbo.spring.annotation.DubboService;
import org.ibase4j.model.scheduler.GithubRepo;
import org.ibase4j.provider.scheduler.pipeline.GitHubRepoDaoPipeline;
import org.springframework.cache.annotation.CacheConfig;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.model.OOSpider;

/**
 * Created by admin on 2016-11-16.
 */

@CacheConfig(cacheNames = "gitHubRepo")
@DubboService(interfaceClass = IGitHubRepoProvider.class)
public class GitHubRepoProviderImpl extends BaseProviderImpl<GithubRepo> implements  IGitHubRepoProvider {


    public void spiderGitHub(){
        OOSpider.create(Site.me().setSleepTime(1000)
                , new GitHubRepoDaoPipeline(), GithubRepo.class)
                .addUrl("https://github.com/code4craft").thread(1).run();
    }

}
